import React from 'react';
import { TimePicker } from 'antd';
import { ConfigProvider } from 'antd';
import zh_CN from 'antd/lib/locale-provider/zh_CN';
import 'moment/locale/zh-cn';

const ShowTimePicker = (props: any) => {
  const { type, ...rest } = props;
  return (
    <ConfigProvider locale={zh_CN}>
      {type === 'rangePicker' ? <TimePicker.RangePicker {...rest} /> : <TimePicker {...rest} />}
    </ConfigProvider>
  );
};

export default ShowTimePicker;
